package com.heima.wemedia.controller;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.entity.WmNews;
import com.heima.wemedia.service.WmChannelService;
import com.heima.wemedia.service.WmNewsService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * 自媒体频道表(WmChannel)表控制层
 *
 * @author makejava
 * @since 2022-04-12 15:48:48
 */
@RestController
@RequestMapping("/api/v1/channel")
public class WmChannelController {
    /**
     * 服务对象
     */
    @Resource
    private WmChannelService wmChannelService;

    @Resource
    private WmNewsService wmNewsService;
@GetMapping("/channels")
    public ResponseResult selectChannels(){
        return ResponseResult.okResult(wmChannelService.selectChannels());
}
@GetMapping("/one/{id}")
   public ResponseResult selectById(@PathVariable("id") Long id){
    return wmChannelService.selectById(id);
}
@GetMapping("/del_news/{id}")
    public ResponseResult deletById(@PathVariable("id")Long id){
    return wmNewsService.delectById(id);
}

}

